//
//  Macro.h
//  project-demo-oc
//
//  Created by 赵隆杰 on 2021/6/1.
//

#ifndef Macro_h
#define Macro_h

#define KeyWindow [UIApplication sharedApplication].keyWindow
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define RGB(r, g, b) RGBA(r,g,b,1.0f)
#define RandomColor RGB(arc4random_uniform(256),arc4random_uniform(256),arc4random_uniform(256))
#define UI_COLOR_FROM_RGB_ALPHA(rgbValue, a) RGBA(((float)((rgbValue & 0xFF0000) >> 16)),((float)((rgbValue & 0x00FF00) >>  8)),((float)((rgbValue & 0x0000FF) >>  0)),(float)a)
#define UI_COLOR_FROM_RGB(rgbValue) UI_COLOR_FROM_RGB_ALPHA(rgbValue, 1.0)


// 底部安全区域的值
#define SL_VC_Bottom_SafeInset [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom
// 是否是全面屏
#define sl_isIphoneX (SL_VC_Bottom_SafeInset > 0)
//状态栏高度
#define SL_VC_StatusBar_HEIGHT ([UIApplication sharedApplication].keyWindow.safeAreaInsets.top ?: [[UIApplication sharedApplication] statusBarFrame].size.height)
//导航栏高度
#define SL_VC_HEADER_HEIGHT (SL_VC_StatusBar_HEIGHT + 44.0)
//工具栏高度
#define SL_VC_TabBar_HEIGHT (SL_VC_Bottom_SafeInset + 49.0)

#define SL_mainScreen_Bounds [UIScreen mainScreen].bounds
//屏幕宽度
#define SL_WINDOW_WIDTH CGRectGetWidth(SL_mainScreen_Bounds)
//屏幕高度
#define SL_WINDOW_HEIGHT CGRectGetHeight(SL_mainScreen_Bounds)

#define FontOfSize(a) [UIFont systemFontOfSize:a]
#define boldFontOfSize(a) [UIFont boldSystemFontOfSize:a]

#endif /* Macro_h */
